package com.scnario;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

class Employee{
	private int id;
	private String name;
	private long phone;
	private String designation;
	private double salary;
	public Employee(){}
	public Employee(int id, String name, long phone, String designation,
			double salary) {
		super();
		this.id = id;
		this.name = name;
		this.phone = phone;
		this.designation = designation;
		this.salary = salary;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public long getPhone() {
		return phone;
	}
	public void setPhone(long phone) {
		this.phone = phone;
	}
	public String getDesignation() {
		return designation;
	}
	public void setDesignation(String designation) {
		this.designation = designation;
	}
	public double getSalary() {
		return salary;
	}
	public void setSalary(double salary) {
		this.salary = salary;
	}
	public String toString(){
		return id+"\t"+name+"\t"+phone+"\t"+designation+"\t"+salary;
	}
	
}

public class TestEmployee {
	public static void main(String[] args) {
		List<Employee> list=new ArrayList<Employee>();
		list.add(new Employee(101, "deepak", 9999, "SE", 45000));
		list.add(new Employee(104, "ajay", 9999, "AE", 12000));
		list.add(new Employee(103, "amit", 9999, "SSE", 40000));
		list.add(new Employee(102, "avinash", 9999, "SSE", 43000));
		list.add(new Employee(108, "raman", 9999, "SSE", 65000));
		list.add(new Employee(106, "soman", 9999, "SE", 13000));
		System.out.println("All Employee's Data\n");
		for(Employee emp:list){
			System.out.println(emp);
		}
		System.out.println("\nList of Employee's whose salary is greater than 20000");
		getEmpData(list);
	}
	public static List<Employee> getEmpData(List<Employee> list){
		Map<Integer, Employee> map=new HashMap<Integer, Employee>();
		for(Employee empObject:list){
		
			if(empObject.getSalary()>20000){
				map.put(empObject.getId(), empObject);
				
			}
		}
		for(Integer key:map.keySet()){
			System.out.println(map.get(key));
		}
		
		return list;
	}

}
